import request from '@/utils/request'

// 子级商户利润

// 列表
export function getProfitList(uid) {
  return request({
    url: `/merchant/api/v1/profit/ticket/${uid}`,
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'get'
  })
}
// 设置
export function editProfit(data) {
  return request({
    url: '/merchant/api/v1/profit/ticket',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}

// 取消
export function deleteProfit(uid, code) {
  return request({
    url: `/merchant/api/v1/profit/ticket/${uid}/${code}`,
    method: 'delete',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 门票通用利润

// 列表
export function getTicketList() {
  return request({
    url: '/merchant/api/v1/profit/base/ticket',
    method: 'get'
  })
}
// 设置
export function editTicket(data) {
  return request({
    url: '/merchant/api/v1/profit/base/ticket',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}
// 取消
export function deleteTicket(code) {
  return request({
    url: `/merchant/api/v1/profit/base/ticket/${code}`,
    method: 'delete',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
